<%@include file="../../init.jsp"%>
<%@include file="../../header.jsp"%>

<% if ( main.loggedIn()) { %>
<br>
  <form action="/" method="POST">
   
    Title: <input type="text" size="40" name="title"><br>
    Project ID: <input type="text" size="40" name="projectId"><br>
    Start Date: <input type="text" size="40" name="startDate"><br>
    Due Date: <input type="text" size="40" name="dueDate"><br>
    Parent / Task: <select name="parentProject">
    <option value="">---Select Project---</option>
    <%

    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    Query query = new Query("Project");
    List<Entity> projects = datastore.prepare(query).asList(FetchOptions.Builder.withLimit(10));
		
		for (Entity project : projects) {
			out.print("<option value='");
			out.print(project.getKey().getId()+"'>" + project.getProperty("title"));
			out.print("</option>");
		}
		
		
	
  %></select>
  
	<br>Visibility: <select name="visibility">
			  <option value="true">Public</option>
			  <option value="false">Private</option>
	  		</select><br>
	Client(s): <select name="clients">
			 <% for(int i=0; i <5; i++) out.print("<option>Client " + i + "</option>"); %>
			   </select>
    <br>
    Description:<br>
    <textarea cols="80" rows="20" name="description"></textarea><br>
    <input type="submit" name="submit" value="Submit">
  </form>

  <hr>
  <a href="/projectList">View All</a>
  <% } %>
</body>
</html>